﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/_Layout.cshtml";
   DTcms.Model.channel_site site = ViewData["site"] as DTcms.Model.channel_site;
   DTcms.Model.siteconfig config = ViewData["config"] as DTcms.Model.siteconfig;
   BaseController bc = ViewBag.BasePage as BaseController;
   ArticleController c = ViewBag.This as ArticleController;
   ViewBag.Title = "购物商城 - " + site.name;
   string channel = "goods";
}
<!--分类列表-->
@{ 
DataTable categoryList = bc.get_category_child_list(channel,0);
foreach(DataRow cdr in categoryList.Rows){
<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@bc.linkurl("goods_list",cdr["id"])">@cdr["title"]<em></em></a>
    </h2>
    <p>
      <!--小类-->
      @{ 
      DataTable bcategoryList = bc.get_category_child_list(channel,Convert.ToInt32(cdr["id"]));
      int bcdrcount = 0;
      foreach(DataRow bcdr in bcategoryList.Rows){
         bcdrcount ++;
         if(bcdrcount==1){
         <a class="no-bg" href="@bc.linkurl("goods_list",bcdr["id"])">@bcdr["title"]</a>
         }else{
         <a href="@bc.linkurl("goods_list",bcdr["id"])">@bcdr["title"]</a>
         }
      }
      }
      <!--/小类-->
    </p>
  </div>
  <div class="wrapper igoods clearfix">
    <div class="img-list2">
      <ul>
        @{ 
        DataTable dt = bc.get_article_list(channel, Convert.ToInt32(cdr["id"]), 5, "status=0");
        foreach(DataRow dr in dt.Rows){
        <li>
          <div class="wrap-box">
            <div class="img-box">
              <a title="@dr["title"]" href="@bc.linkurl("goods_show",dr["id"])">
                <img src="@dr["img_url"]" />
              </a>
            </div>
            <div class="info">
              <h3><a title="@dr["title"]" href="@bc.linkurl("goods_show",dr["id"])">@dr["title"]</a></h3>
              <div class="col">
                <b>￥@dr["sell_price"]</b>元
              </div>
              <div class="col">
                <i>库存：@dr["stock_quantity"]件</i>
                市场价：<s>@dr["market_price"]</s>
              </div>
            </div>
          </div>
        </li>
        }
        }
      </ul>
    </div>
    
  </div>
</div>
}
}
<!--/分类列表-->